﻿#region

using Frosty.Conf;
using Frosty.Helpers;

using LazyLib.ActionBar;
using LazyLib.Combat;
using LazyLib.Wow;

#endregion

namespace Frosty.Abilities
{
    public class RuneTap : PDamageAction
    {
        public BarSpell Spell;

        /// <summary>
        /// Initializes a new instance of the <see cref="RuneTap"/> class.
        /// </summary>
        /// <param name="priority">The priority.</param>
        /// <param name="spellName">Name of the spell.</param>
        public RuneTap(int priority, string spellName)
            : base(priority, spellName)
        {
            Spell = BarMapper.GetSpellByName(spellName);
        }

        /// <summary>
        /// Gets a value indicating whether this instance is wanted.
        /// </summary>
        /// <value>
        ///   <c>true</c> if this instance is wanted; otherwise, <c>false</c>.
        /// </value>
        public override bool IsWanted
        {
            get
            {
                return base.IsWanted && ConfigValues.RuneTap && Runes.BloodAvail() && ObjectManager.MyPlayer.Health < 60;
            }
        }
    }

    public class HealRuneTap : PSelfHealAction
    {
        public BarSpell Spell;

        /// <summary>
        /// Initializes a new instance of the <see cref="RuneTap"/> class.
        /// </summary>
        /// <param name="priority">The priority.</param>
        /// <param name="spellName">Name of the spell.</param>
        public HealRuneTap(int priority, string spellName)
            : base(priority, spellName)
        {
            Spell = BarMapper.GetSpellByName(spellName);
        }

        /// <summary>
        /// Gets a value indicating whether this instance is wanted.
        /// </summary>
        /// <value>
        ///   <c>true</c> if this instance is wanted; otherwise, <c>false</c>.
        /// </value>
        public override bool IsWanted
        {
            get
            {
                return base.IsWanted && ConfigValues.RuneTap && Runes.BloodAvail() && ObjectManager.MyPlayer.Health < 60;
            }
        }
    }
}